//
//  CZAVAudioManager.h
//  translateAi
//
//  Created by 陈镇 on 2023/5/10.
//

#import <Foundation/Foundation.h>
#define kMaxTimeLength 20
NS_ASSUME_NONNULL_BEGIN

@protocol CZAVAudioManagerDelegate <NSObject>
//录音时间太短
-(void)audioRecorderUnderTime;
-(void)audioRecorderDidFinishvoiceBase64:(NSString *)voiceBase64 isForceEnd:(BOOL)isForceEnd;


-(void)auidoPlayDidFinishSuccess:(BOOL)success;
@end




@interface CZAVAudioManager : NSObject


+(CZAVAudioManager *)shareManager;
- (void)startRecordDelegate:(id<CZAVAudioManagerDelegate>)delegate;
- (void)endRecord;
- (void)abandonRecord;


- (void)playVoiceData:(NSData *)data delegate:(nullable id<CZAVAudioManagerDelegate>)delegate;
- (void)playVoiceURL:(NSString *)url delegate:(nullable id<CZAVAudioManagerDelegate>)delegate;
@end

NS_ASSUME_NONNULL_END
